package hsl.study.controller;


import jakarta.annotation.Resource;
import org.springframework.ai.chat.model.ChatModel;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Flux;

/**
 * @Description:
 * @Author: hsl
 * @CreateDate: 2025/8/4 14:07
 * @Version: 1.0
 */


@RestController
@RequestMapping("/noToolCalling")
public class NoToolCallingController {

    @Resource
    private ChatModel chatModel;

    /**
     * http://localhost:7013/noToolCalling/chat?msg=你是谁
     * @param msg
     * @return
     */
    @GetMapping("/chat")
    public Flux<String> chat(@RequestParam(name = "msg", defaultValue = "现在几点了") String msg) {
        return chatModel.stream(msg);
    }
}
